<form action="{% url 'polls:vote' question.id %}" method="post" class="vote-form">
    {% csrf_token %}
    <div class="form-container">
        <div class="form-header">
            <div class="header-icon">
                <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path>
                </svg>
            </div>
            <h1 class="vote-title">{{ question.question_text }}</h1>
            <p class="vote-subtitle">请选择您认为最合适的选项</p>
        </div>
        
        {% if error_message %}
        <div class="error-message">
            <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                <circle cx="12" cy="12" r="10"></circle>
                <line x1="12" y1="8" x2="12" y2="12"></line>
                <line x1="12" y1="16" x2="12.01" y2="16"></line>
            </svg>
            <span>{{ error_message }}</span>
        </div>
        {% endif %}
        
        <div class="choices-container">
            {% for choice in question.choice_set.all %}
            <label class="choice-item">
                <input type="radio" name="choice" value="{{ choice.id }}" class="choice-radio">
                <span class="radio-custom"></span>
                <span class="choice-content">
                    <span class="choice-text">{{ choice.choice_text }}</span>
                    <span class="choice-percentage"></span>
                </span>
                <span class="choice-hover-effect"></span>
            </label>
            {% endfor %}
        </div>
        
        <div class="form-footer">
            <button type="submit" class="submit-btn">
                <span class="btn-text">确认投票</span>
                <span class="btn-icon">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                        <path d="M5 12h14M12 5l7 7-7 7"></path>
                    </svg>
                </span>
            </button>
        </div>
    </div>
</form>

<style>
    :root {
        --primary-color: #6366f1;
        --primary-light: #a5b4fc;
        --primary-dark: #4f46e5;
        --success-color: #10b981;
        --error-color: #ef4444;
        --text-color: #374151;
        --text-light: #6b7280;
        --bg-color: #f9fafb;
        --card-color: #ffffff;
        --border-color: #e5e7eb;
        --shadow-color: rgba(0, 0, 0, 0.05);
    }
    
    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    
    body {
        background-color: var(--bg-color);
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
        color: var(--text-color);
        line-height: 1.5;
    }
    
    .vote-form {
        max-width: 640px;
        margin: 2rem auto;
        padding: 0 1rem;
    }
    
    .form-container {
        background-color: var(--card-color);
        border-radius: 16px;
        box-shadow: 0 10px 25px -5px var(--shadow-color);
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .form-header {
        padding: 2rem 2rem 1.5rem;
        text-align: center;
        position: relative;
    }
    
    .header-icon {
        width: 56px;
        height: 56px;
        margin: 0 auto 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
        border-radius: 50%;
        color: white;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    }
    
    .header-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .vote-title {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--text-color);
        margin-bottom: 0.5rem;
    }
    
    .vote-subtitle {
        color: var(--text-light);
        font-size: 0.95rem;
    }
    
    .error-message {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        background-color: #fef2f2;
        color: var(--error-color);
        padding: 1rem 1.5rem;
        margin: 0 1.5rem 1.5rem;
        border-radius: 8px;
        font-size: 0.95rem;
        border-left: 4px solid var(--error-color);
    }
    
    .error-message svg {
        flex-shrink: 0;
    }
    
    .choices-container {
        padding: 0 1.5rem 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .choice-item {
        position: relative;
        display: flex;
        align-items: center;
        padding: 1rem 1.25rem;
        background-color: var(--card-color);
        border-radius: 12px;
        border: 1px solid var(--border-color);
        cursor: pointer;
        transition: all 0.3s ease;
        overflow: hidden;
    }
    
    .choice-item:hover {
        border-color: var(--primary-light);
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
        transform: translateY(-2px);
    }
    
    .choice-radio {
        position: absolute;
        opacity: 0;
        height: 0;
        width: 0;
    }
    
    .radio-custom {
        position: relative;
        width: 20px;
        height: 20px;
        border: 2px solid var(--border-color);
        border-radius: 50%;
        margin-right: 1rem;
        transition: all 0.3s ease;
    }
    
    .choice-item:hover .radio-custom {
        border-color: var(--primary-light);
    }
    
    .choice-radio:checked ~ .radio-custom {
        border-color: var(--primary-color);
        background-color: var(--primary-color);
    }
    
    .radio-custom::after {
        content: "";
        position: absolute;
        display: none;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 8px;
        height: 8px;
        background-color: white;
        border-radius: 50%;
    }
    
    .choice-radio:checked ~ .radio-custom::after {
        display: block;
    }
    
    .choice-content {
        flex: 1;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .choice-text {
        font-size: 1rem;
        color: var(--text-color);
    }
    
    .choice-percentage {
        font-size: 0.85rem;
        color: var(--text-light);
    }
    
    .choice-hover-effect {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, rgba(99, 102, 241, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .choice-item:hover .choice-hover-effect {
        opacity: 1;
    }
    
    .form-footer {
        padding: 1.5rem;
        border-top: 1px solid var(--border-color);
        background-color: #f9fafb;
    }
    
    .submit-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        width: 100%;
        padding: 1rem;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 6px rgba(99, 102, 241, 0.2);
    }
    
    .submit-btn:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, #4338ca 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
    }
    
    .btn-icon {
        display: flex;
        transition: transform 0.3s ease;
    }
    
    .submit-btn:hover .btn-icon {
        transform: translateX(4px);
    }
    
    @media (max-width: 640px) {
        .form-header {
            padding: 1.5rem 1rem 1rem;
        }
        
        .choices-container {
            padding: 0 1rem 1rem;
        }
        
        .form-footer {
            padding: 1rem;
        }
    }
</style>